home *** CD-ROM | disk | FTP | other *** search
INI File | 2001-04-11 | 1.4 KB | 61 lines |
- [for | for block]
- for (int i=0; i<|; i++) {}
-
- [prog | Java Program Template]
- public class |MyProg {
-
- /** Code documentation here */
- public static void main(String[] args) {
- /* multi-line and semi-line comments here */
- // one-line comments here
- System.out.println("Hello, world");
- }
- }
-
- [servlet | Java Servlet Skeleton]
- import java.io.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
-
- public class |MyServlet extends HttpServlet {
- PrintWriter out;
-
- public void doGet(HttpServletRequest req, HttpServletResponse res) {
- try {
- res.setContentType("text/html");
- out = res.getWriter();
- String html = "<html>Hello, world</html>";
- out.println(html);
- }
- catch (Exception e) { e.printStackTrace(); }
- }
-
- public void doPost(HttpServletRequest req, HttpServletResponse res) {
- try {
- res.setContentType("text/html");
- out = res.getWriter();
- String html = "<html>Hello, world</html>";
- out.println(html);
- }
- catch (Exception e) { e.printStackTrace(); }
- }
- }
-
- [try | try-catch block]
- try {
- |
- }
- catch (Exception e) {
- System.out.println("Unexpected exception");
- e.printStackTrace();
- }
- finally {}
-
- [while | while block]
- int i=0;
- while (i < |) {
-
- i++;
- }
-
-